import pymysql
import itchat

def getConn():
    conn=pymysql.Connection(host="localhost",port=3306,user="root",
                            password="root",database="studentMananger")
    return conn
def close(conn,cursor):
    conn.close()
    cursor.close()

def close(cursor):
    cursor.close()

def send_news(new=None,user=None,out=None):
    itchat.auto_login(hotReload=True)
    if out is True:
        itchat.send("班主任：{} 退出了信息管理系统".format(user),'filehelper')
    elif out is False:
        itchat.send("班主任：{} 进入了信息管理系统".format(user), 'filehelper')
    if out is None:
        itchat.send(new, 'filehelper')
